<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePayLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('pay_logs', function (Blueprint $table) {
            $table->id();
            $table->string('pay_sn',100)->comment('支付编号');
            $table->string('pay_code',100)->comment('支付码：uuid');
            $table->string('payment_method',100)->comment('支付方式：alipay；wechat；');
            $table->decimal('total_amount',8, 2)->comment('总金额');
            $table->tinyInteger('status')->default(0)->comment('支付状态：0-待支付；1-已支付；2-已过期（作废）；');
            $table->text('result')->comment('名称');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('pay_logs');
    }
}
